package com.luoye.unionlotto;

import java.util.Collections;
import java.util.List;

public class Unionlotto implements Comparable<Unionlotto> {
    String date;
    List<String> redBalls;
    String blueBall;

    public Unionlotto() {
    }

    public Unionlotto(String date, List<String> redBalls, String blueBall) {
        this.date = date;
        this.redBalls = redBalls;
        Collections.sort(this.redBalls);
        this.blueBall = blueBall;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public List<String> getRedBalls() {
        return redBalls;
    }

    public void setRedBalls(List<String> redBalls) {
        this.redBalls = redBalls;
        Collections.sort(this.redBalls);
    }

    public String getBlueBall() {
        return blueBall;
    }

    public void setBlueBall(String blueBall) {
        this.blueBall = blueBall;
    }

    @Override
    public String toString() {
        return "Unionlotto{" +
                "date='" + date + '\'' +
                ", redBalls=" + redBalls +
                ", blueBall='" + blueBall + '\'' +
                '}';
    }

    public int compareTo(Unionlotto o) {
        return this.getDate().compareTo(o.getDate());
    }
}
